package com.example.demo.common

import com.example.demo.exception.ErrorCode
import java.io.Serializable

/**
 * 全局响应类
 */
class BaseResponse<Any> : Serializable {
    var code: Int? = 0
    var msg: String? = null
    var data: Any? = null
    constructor(code: Int, msg: String, data: Any?){
        this.code = code
        this.msg = msg
        this.data = data
    }
    constructor(data: Any?) {
        this.data = data
    }
    constructor(code: Int?, msg: String?) {
        this.code = code
        this.msg = msg
    }
    constructor(code: Int,data: Any?){
        this.code = code
        this.data = data
    }
    constructor(ErrorCode: ErrorCode){
        this.code = ErrorCode.code
        this.msg = ErrorCode.message
        this.data = null
    }
}